<div style="min-width:1200px;">
<nz-breadcrumb class="breadcrumb-pos">
  <i nz-icon type="link" theme="outline" style="color:#1890FF;padding-right:4px"></i>
  <nz-breadcrumb-item>
    合同管理
  </nz-breadcrumb-item>
</nz-breadcrumb>
<div nz-row [nzGutter]="16" style="border-bottom: 1px solid #ccc;margin-bottom: 8px;">
  <div nz-col [nzSpan]="6">
    <nz-form-item nzFlex>
      <nz-form-label>设备名称</nz-form-label>
      <nz-form-control>
        <input nz-input [(ngModel)]="name">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="6">
    <nz-form-item nzFlex>
      <nz-form-label>租赁客户</nz-form-label>
      <nz-form-control>
        <input nz-input [(ngModel)]="companyName">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>状态</nz-form-label>
      <nz-select [(ngModel)]="status" style="margin-top:3px;width: 90px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option [nzLabel]="'未开始'" [nzValue]="'0'"></nz-option>
        <nz-option [nzLabel]="'进行中'" [nzValue]="'1'"></nz-option>
        <nz-option [nzLabel]="'自动结束'" [nzValue]="'2'"></nz-option>
        <nz-option [nzLabel]="'手动结束'" [nzValue]="'3'"></nz-option>
      </nz-select>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="6" style="min-width:200px;">
    <nz-form-item nzFlex>
      <nz-form-label>结算周期</nz-form-label>
      <nz-select [(ngModel)]="payType" style="margin-top:3px;width: 90px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option nzLabel="年结算" nzValue="0"></nz-option>  
        <nz-option nzLabel="半年结算" nzValue="1"></nz-option>  
        <nz-option nzLabel="季结算" nzValue="2"></nz-option>  
        <nz-option nzLabel="月结算" nzValue="3"></nz-option>  
      </nz-select>
      <button nz-button [nzType]="'primary'" [nzLoading]="btn_loading" style="margin:3px 0 0 20px;" (click)="getSignlist()">查询</button>
    </nz-form-item>
  </div>
</div>

<div class="add_btn">
  <button nz-button style="float:right" (click)="exportOut()">导出Excel</button>
</div>
<nz-table #basicTable [nzData]="signlist" [nzLoading]="loading" [nzShowPagination]="false" [nzBordered]="true">
  <thead>
    <tr>
      <th>合同单号<hr>设备名称</th>
      <th>租赁客户<hr>状态</th>
      <th>套餐金额</th>
      <th>结算周期<hr>押金</th>
      <th>套餐送量<hr>黑白 / 彩色</th>
      <th>起始量<hr>黑白 / 彩色</th>
      <th>结束量<hr>黑白 / 彩色</th>
      <th>开始时间<hr>结束时间</th>
      <th>添加时间<div><hr>清算时间</div></th>
      <th>存放位置</th>
      <th nzWidth="60px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of signlist">
      <td>{{data.number}}<hr>{{printerinfo[data.printerId].name}}</td>
      <td>{{userinfo[data.userId].companyName}}<hr><div [ngClass]="{'green':data.status==1}">{{data.statusStr}}</div></td>
      <td>{{data.setMealMoney}}</td>
      <td>{{data.payTypeStr}}<hr>{{data.cashPledge}}</td>
      <td>{{data.blackPresented}}/{{data.coloursPresented}}</td>
      <td>{{data.blackInit || data.blackInit ==0?data.blackInit:"-"}}/{{data.coloursInit || data.coloursInit ==0?data.coloursInit:"-"}}</td>
      <td>{{data.blackEnd?data.blackEnd:"-"}}/{{data.coloursEnd?data.coloursEnd:"-"}}</td>
      <td>{{data.signedBegin?data.signedBegin.slice(0,10):'--'}}<hr> {{data.signedEnd?data.signedEnd.slice(0,10):'--'}}</td>
      <td>{{data.dateAdd?data.dateAdd.slice(0,10):'--'}}<hr>{{(data.status == 2 || data.status == 3)?data.dateUpdate.slice(0,10):'--'}}</td>
      <td>{{data.printerLocation?data.printerLocation:"-"}}</td>
      <td>
        <a style="color:rgb(25, 190, 182);" routerLink="/main/signinfo/{{data.id}}">详情</a>
      </td>
    </tr>
  </tbody>
</nz-table>
<nz-pagination style="float:right;margin-top:12px" [nzPageIndex]="PageIndex" [nzPageSize]="PageSize" [nzTotal]="PageTotal" (nzPageIndexChange)="PageIndexChange($event)" [nzHideOnSinglePage]="true" [nzShowTotal]="totalTemplate"></nz-pagination>
<ng-template #totalTemplate let-total>
  共 {{total}} 条数据
</ng-template>
</div>